<template lang="html">
  <tr>
    <td class="col-sm-1">{{detail.id}}</td>
    <td class="col-sm-1">{{detail.name}}</td>
    <td class="col-sm-1">{{detail.investerName}}</td>
    <td class="col-sm-1">{{detail.isNew ? '是' : '否'}}</td>
    <td class="col-sm-1">{{detail.isHomepage ? '是' : '否'}}</td>
    <td class="col-sm-1">{{detail.riskLevel}}</td>
    <td class="col-sm-1">{{detail.status == 1 ? '已上架' : '已下架'}} </td>
    <td class="col-sm-1 text-right">
      <button class="btn btn-sm" v-if=" index === 0 " :style="{ opacity: 0, 'pointer-events': 'none' }">占位</button>
      <button v-if="index !== 0 " class="btn btn-sm btn-success"
        @click="moveUp(index)">上移</button>
      <button v-if="index !== (list.length - 1)" class="btn btn-sm btn-success"
        @click="moveDown(index)">下移</button>
    </td>
    <td class="col-sm-4 text-right ly-row-flex">
      <a v-link="{ path: '/betaId/' + detail.id }" class="btn btn-sm btn-primary">订阅量查询</a>
      <update-invester-portfolio
        :id="detail.id"
        ></update-invester-portfolio>
      <update-invester-buy-type
        :id="detail.id"
        :detail="deepClone(detail)"
        ></update-invester-buy-type>
      <button class="btn btn-sm"
        :class="{'btn-danger': detail.status === 1, 'btn-primary': detail.status === 0}"
       @click="evtSetStatus(detail)">{{detail.status === 1 ? '下架' : '上架'}}</button>
      <button class="btn btn-sm btn-danger" @click="deleteInvester(detail)">删除</button>
    </td>
  </tr>
</template>

<script src="./invester-portfolio-item.js"></script>
<style src="./invester-portfolio-item.css"></style>
